/*     */ package com.zimbra.cs.util.tnef;
/*     */ 
/*     */ import com.zimbra.common.calendar.ZCalendar;
/*     */ import com.zimbra.common.calendar.ZCalendar.ZCalendarBuilder;
/*     */ import com.zimbra.common.calendar.ZCalendar.ZComponent;
/*     */ import com.zimbra.common.calendar.ZCalendar.ZParameter;
/*     */ import com.zimbra.common.calendar.ZCalendar.ZProperty;
/*     */ import com.zimbra.common.calendar.ZCalendar.ZVCalendar;
/*     */ import com.zimbra.common.service.ServiceException;
/*     */ import com.zimbra.common.util.ByteUtil;
/*     */ import com.zimbra.common.util.Log;
/*     */ import com.zimbra.common.util.Log.Level;
/*     */ import com.zimbra.common.util.ZimbraLog;
/*     */ import com.zimbra.common.zmime.ZMimeMessage;
/*     */ import com.zimbra.common.zmime.ZSharedFileInputStream;
/*     */ import com.zimbra.cs.mime.MimeVisitor;
/*     */ import com.zimbra.cs.mime.MimeVisitor.VisitPhase;
/*     */ import com.zimbra.cs.util.JMSession;
/*     */ import com.zimbra.cs.util.tnef.mapi.RecurrenceDefinition;
/*     */ import java.io.ByteArrayInputStream;
/*     */ import java.io.ByteArrayOutputStream;
/*     */ import java.io.File;
/*     */ import java.io.FileOutputStream;
/*     */ import java.io.FileWriter;
/*     */ import java.io.IOException;
/*     */ import java.io.InputStream;
/*     */ import java.io.OutputStreamWriter;
/*     */ import java.io.PrintStream;
/*     */ import java.io.UnsupportedEncodingException;
/*     */ import java.io.Writer;
/*     */ import java.util.ArrayList;
/*     */ import java.util.List;
/*     */ import javax.mail.MessagingException;
/*     */ import javax.mail.Part;
/*     */ import javax.mail.internet.MimeBodyPart;
/*     */ import javax.mail.internet.MimeMessage;
/*     */ import javax.mail.internet.MimeMultipart;
/*     */ import javax.mail.internet.MimePart;
/*     */ import javax.mail.util.SharedFileInputStream;
/*     */ import net.fortuna.ical4j.data.ContentHandler;
/*     */ import net.fortuna.ical4j.data.ParserException;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class TestMain
/*     */ {
/*  65 */   static Log sLog = ZimbraLog.tnef;
/*     */   private static final String UTF8 = "utf-8";
/*     */   
/*  68 */   private static TnefToICalendar getConverter() { return new DefaultTnefToICalendar(); }
/*     */   
/*     */ 
/*     */   private static boolean doConversion(MimeMessage mm, Writer out, TnefToICalendar converter, File tnefFile, boolean debug)
/*     */     throws ServiceException, IOException, MessagingException
/*     */   {
/*  74 */     boolean successful = false;
/*     */     
/*  76 */     TNEFPartFinder finder = new TNEFPartFinder();
/*  77 */     finder.accept(mm);
/*  78 */     MimePart tnefPart = finder.getTNEFPart();
/*  79 */     if (tnefPart == null) {
/*  80 */       throw ServiceException.FAILURE("No TNEF part in the message!", null);
/*     */     }
/*  82 */     if (tnefFile != null) {
/*  83 */       FileOutputStream wout = null;
/*     */       try {
/*  85 */         byte[] bytes = ByteUtil.getContent(tnefPart.getInputStream(), tnefPart.getSize());
/*  86 */         wout = new FileOutputStream(tnefFile);
/*  87 */         wout.write(bytes);
/*  88 */         wout.flush();
/*     */       } finally {
/*  90 */         if (wout != null) {
/*  91 */           wout.close();
/*     */         }
/*     */       }
/*     */     }
/*     */     
/*  96 */     if (debug)
/*     */     {
/*  98 */       String desc = getPlainText(mm);
/*  99 */       if (desc != null) {
/* 100 */         System.out.println("<<< TEXT PART BEGIN >>>");
/* 101 */         System.out.println(desc);
/* 102 */         System.out.println("<<< TEXT PART END >>>");
/*     */       }
/*     */     }
/*     */     
/* 106 */     if (converter == null) {
/* 107 */       throw ServiceException.FAILURE("No converter!", null);
/*     */     }
/* 109 */     TestContentHandler icalGen = new TestContentHandler(debug);
/*     */     
/* 111 */     successful = converter.convert(mm, tnefPart.getInputStream(), icalGen);
/* 112 */     if (successful) {
/* 113 */       for (ZCalendar.ZVCalendar cal : icalGen.getCals()) {
/* 114 */         cal.toICalendar(out);
/*     */       }
/*     */     }
/* 117 */     out.flush();
/* 118 */     return successful;
/*     */   }
/*     */   
/*     */ 
/*     */   private static class TNEFPartFinder
/*     */     extends MimeVisitor
/*     */   {
/*     */     private MimePart mTNEFPart;
/*     */     
/* 127 */     public MimePart getTNEFPart() { return this.mTNEFPart; }
/*     */     
/*     */     private static boolean matchingType(Part part) throws MessagingException {
/* 130 */       String type = part.getContentType();
/* 131 */       return (type != null) && (((type = type.toLowerCase()).startsWith("application/ms-tnef")) || (type.startsWith("application/vnd.ms-tnef")));
/*     */     }
/*     */     
/*     */ 
/*     */ 
/*     */     protected boolean visitBodyPart(MimeBodyPart bp)
/*     */       throws MessagingException
/*     */     {
/* 139 */       if ((this.mTNEFPart == null) && (matchingType(bp)))
/* 140 */         this.mTNEFPart = bp;
/* 141 */       return false;
/*     */     }
/*     */     
/*     */     protected boolean visitMessage(MimeMessage mm, MimeVisitor.VisitPhase visitKind) throws MessagingException
/*     */     {
/* 146 */       if ((this.mTNEFPart == null) && (matchingType(mm)))
/* 147 */         this.mTNEFPart = mm;
/* 148 */       return false;
/*     */     }
/*     */     
/*     */     protected boolean visitMultipart(MimeMultipart mp, MimeVisitor.VisitPhase visitKind) throws MessagingException
/*     */     {
/* 153 */       return false;
/*     */     }
/*     */   }
/*     */   
/*     */   private static String getPlainText(MimeMessage mm) throws MessagingException, IOException
/*     */   {
/* 159 */     PlainTextFinder finder = new PlainTextFinder();
/* 160 */     finder.accept(mm);
/* 161 */     return finder.getPlainText();
/*     */   }
/*     */   
/*     */ 
/*     */   private static void usage()
/*     */   {
/* 167 */     System.err.println("Usage: java com.zimbra.cs.util.tnef.TestMain [-v] [-debug]");
/* 168 */     System.err.println("            -i <MIME file> [-o <iCalendar file>] [-t <tnef file>] [-r <recurInfo file>]");
/* 169 */     System.err.println("  or");
/* 170 */     System.err.println("            -D <Output Directory> <MIME files>...\n");
/* 171 */     System.err.println("-v: verbose output");
/* 172 */     System.err.println("-debug: Set TNEF specific logging level to DEBUG");
/* 173 */     System.err.println("-i: MIME input file TNEF part");
/* 174 */     System.err.println("-o: iCalendar output file; if unspecified, output goes to stdout");
/* 175 */     System.err.println("-t: TNEF output file; The main TNEF attachment will be written here if present");
/* 176 */     System.err.println("-r: A diagnostic string representing any recurrence property will be written here");
/* 177 */     System.err.println("-D: Output directory to contain all output files.");
/* 178 */     System.err.println("    Supplied MIME files are assumed to have suffix \".eml\"");
/* 179 */     System.exit(1);
/*     */   }
/*     */   
/*     */   public static void main(String[] args) throws Exception {
/* 183 */     ZimbraLog.toolSetupLog4jConsole("INFO", true, false);
/*     */     
/* 185 */     boolean verbose = false;
/* 186 */     boolean inputWasIcs = false;
/* 187 */     File mimeFile = null;
/* 188 */     File icalFile = null;
/* 189 */     File tnefFile = null;
/* 190 */     File recurInfoFile = null;
/* 191 */     String outDirName = null;
/* 192 */     int firstTestFileArgIndex = 0;
/*     */     
/* 194 */     for (int i = 0; i < args.length; i++) {
/* 195 */       String arg = args[i];
/* 196 */       if (arg != null) {
/* 197 */         if (arg.equalsIgnoreCase("-v")) {
/* 198 */           verbose = true;
/* 199 */         } else if (arg.equalsIgnoreCase("-debug")) {
/* 200 */           sLog.setLevel(Log.Level.debug);
/* 201 */         } else { if (arg.equalsIgnoreCase("-d")) {
/* 202 */             if (i >= args.length - 2)
/* 203 */               usage();
/* 204 */             outDirName = args[(i + 1)];
/* 205 */             firstTestFileArgIndex = i + 2;
/* 206 */             break; }
/* 207 */           if (arg.equalsIgnoreCase("-i")) {
/* 208 */             if (i >= args.length - 1)
/* 209 */               usage();
/* 210 */             String fname = args[(i + 1)];
/* 211 */             mimeFile = new File(fname);
/* 212 */             inputWasIcs = fname.endsWith(".ics");
/* 213 */             i++;
/* 214 */           } else if (arg.equalsIgnoreCase("-o")) {
/* 215 */             if (i >= args.length - 1)
/* 216 */               usage();
/* 217 */             icalFile = new File(args[(i + 1)]);
/* 218 */             i++;
/* 219 */           } else if (arg.equalsIgnoreCase("-t")) {
/* 220 */             if (i >= args.length - 1) {
/* 221 */               usage();
/*     */             }
/* 223 */             tnefFile = new File(args[(i + 1)]);
/* 224 */             i++;
/* 225 */           } else if (arg.equalsIgnoreCase("-r")) {
/* 226 */             if (i >= args.length - 1) {
/* 227 */               usage();
/*     */             }
/* 229 */             recurInfoFile = new File(args[(i + 1)]);
/* 230 */             i++;
/*     */           } else {
/* 232 */             usage();
/*     */           }
/*     */         }
/*     */       }
/*     */     }
/* 237 */     if (inputWasIcs) {
/* 238 */       SharedFileInputStream sfisMime = null;
/* 239 */       ByteArrayOutputStream baos = new ByteArrayOutputStream(10240);
/* 240 */       ByteUtil.copy(sfisMime, false, baos, true);
/* 241 */       writeIcalendarData(mimeFile, baos, icalFile);
/* 242 */       validateIcalendarData(mimeFile, baos);
/* 243 */       return;
/*     */     }
/*     */     
/* 246 */     if (outDirName != null) {
/* 247 */       File outDir = new File(outDirName);
/* 248 */       if (!outDir.exists()) {
/* 249 */         sLog.error("Output directory %s does not exist.", new Object[] { outDirName });
/* 250 */         return;
/*     */       }
/*     */       
/* 253 */       for (int i = firstTestFileArgIndex; i < args.length; i++) {
/* 254 */         mimeFile = new File(args[i]);
/* 255 */         String prefix = mimeFile.getName().replace(".eml", "");
/* 256 */         icalFile = new File(outDir, prefix + ".ics");
/* 257 */         tnefFile = new File(outDir, prefix + ".tnef");
/* 258 */         recurInfoFile = new File(outDir, prefix + ".recurState");
/* 259 */         processMimeFile(mimeFile, icalFile, tnefFile, recurInfoFile, verbose);
/*     */       }
/* 261 */       return;
/*     */     }
/*     */     
/*     */ 
/* 265 */     if (mimeFile == null) {
/* 266 */       usage();
/*     */     }
/* 268 */     processMimeFile(mimeFile, icalFile, tnefFile, recurInfoFile, verbose);
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   private static boolean processMimeFile(File mimeFile, File icalFile, File tnefFile, File recurInfoFile, boolean verbose)
/*     */   {
/* 295 */     if (!mimeFile.exists()) {
/* 296 */       sLog.warn("Can't find MIME file %s", new Object[] { mimeFile.getPath() });
/* 297 */       return false;
/*     */     }
/* 299 */     sLog.debug("Processing MIME file %s", new Object[] { mimeFile.getPath() });
/*     */     
/*     */ 
/* 302 */     InputStream fisMime = null;
/* 303 */     ByteArrayOutputStream baos = new ByteArrayOutputStream(10240);
/* 304 */     Writer baosOut = null;
/* 305 */     boolean doneConversion = false;
/*     */     try {
/* 307 */       fisMime = new ZSharedFileInputStream(mimeFile);
/* 308 */       baosOut = new OutputStreamWriter(baos, "utf-8");
/*     */       
/*     */ 
/* 311 */       MimeMessage mm = new ZMimeMessage(JMSession.getSession(), fisMime);
/* 312 */       TnefToICalendar converter = getConverter();
/* 313 */       doneConversion = doConversion(mm, baosOut, converter, tnefFile, verbose);
/* 314 */       if ((recurInfoFile != null) && 
/* 315 */         ((converter instanceof DefaultTnefToICalendar))) {
/* 316 */         DefaultTnefToICalendar tnef2ical = (DefaultTnefToICalendar)converter;
/* 317 */         RecurrenceDefinition recurDef = tnef2ical.getRecurDef();
/* 318 */         if (recurDef != null) {
/* 319 */           FileWriter rsFileWriter = null;
/*     */           try {
/* 321 */             rsFileWriter = new FileWriter(recurInfoFile);
/* 322 */             rsFileWriter.write(recurDef.toString());
/*     */             try
/*     */             {
/* 325 */               if (rsFileWriter != null) {
/* 326 */                 rsFileWriter.close();
/*     */               }
/*     */             } catch (IOException e) {
/* 329 */               sLog.error("Problem writing to recurInfo file %s", recurInfoFile, e);
/*     */             }
/*     */           }
/*     */           finally
/*     */           {
/*     */             try
/*     */             {
/* 325 */               if (rsFileWriter != null) {
/* 326 */                 rsFileWriter.close();
/*     */               }
/*     */             } catch (IOException e) {
/* 329 */               sLog.error("Problem writing to recurInfo file %s", recurInfoFile, e);
/*     */             }
/*     */           }
/*     */         }
/*     */       }
/*     */       
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/* 356 */       if (doneConversion) {
/*     */         break label538;
/*     */       }
/*     */     }
/*     */     catch (TNEFtoIcalendarServiceException.UnsupportedTnefCalendaringMsgException ex)
/*     */     {
/* 336 */       sLog.warn("Unable to map %s to ICALENDAR", mimeFile.getPath(), ex);
/* 337 */       return 0;
/*     */     } catch (TNEFtoIcalendarServiceException ex) {
/* 339 */       sLog.warn("Problem encountered mapping %s to ICALENDAR", mimeFile.getPath(), ex);
/* 340 */       return 0;
/*     */     } catch (MessagingException ex) {
/* 342 */       sLog.warn("Problem encountered mapping %s to ICALENDAR", mimeFile.getPath(), ex);
/* 343 */       return 0;
/*     */     } catch (ServiceException ex) {
/* 345 */       sLog.warn("Problem encountered mapping %s to ICALENDAR", mimeFile.getPath(), ex);
/* 346 */       return 0;
/*     */     } catch (IOException ex) {
/* 348 */       sLog.warn("IO Problem encountered mapping %s to ICALENDAR", mimeFile.getPath(), ex);
/* 349 */       return 0;
/*     */     } finally {
/*     */       try {
/* 352 */         if (fisMime != null)
/* 353 */           fisMime.close();
/* 354 */       } catch (IOException e) { sLog.error("Problem closing mime stream", e);
/*     */       }
/*     */     }
/* 357 */     return false;
/*     */     
/*     */     label538:
/* 360 */     if (!writeIcalendarData(mimeFile, baos, icalFile)) {
/* 361 */       return false;
/*     */     }
/*     */     
/* 364 */     if (!validateIcalendarData(mimeFile, baos)) {
/* 365 */       return false;
/*     */     }
/* 367 */     return true;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   private static boolean writeIcalendarData(File mimeFile, ByteArrayOutputStream icalBaos, File icalFile)
/*     */   {
/* 378 */     String ical = null;
/* 379 */     Writer wout = null;
/*     */     try {
/* 381 */       ical = icalBaos.toString("utf-8");
/* 382 */       if (icalFile != null) {
/* 383 */         wout = new FileWriter(icalFile);
/*     */       } else
/* 385 */         wout = new OutputStreamWriter(System.out, "utf-8");
/* 386 */       wout.write(ical);
/* 387 */       wout.flush();
/*     */       
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */       boolean bool;
/*     */       
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/* 403 */       return true;
/*     */     }
/*     */     catch (UnsupportedEncodingException e)
/*     */     {
/* 389 */       sLog.warn("Problem Writing ICALENDAR for %s", mimeFile.getPath(), e);
/* 390 */       return false;
/*     */     } catch (IOException e) {
/* 392 */       sLog.warn("Problem Writing ICALENDAR for %s", mimeFile.getPath(), e);
/* 393 */       return false;
/*     */     } finally {
/* 395 */       if ((wout != null) && (icalFile != null)) {
/*     */         try {
/* 397 */           wout.close();
/*     */         } catch (IOException e) {
/* 399 */           sLog.warn("Problem closing Writer for ICALENDAR for %s", mimeFile.getPath(), e);
/* 400 */           return false;
/*     */         }
/*     */       }
/*     */     }
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   private static boolean validateIcalendarData(File mimeFile, ByteArrayOutputStream icalBaos)
/*     */   {
/* 413 */     ByteArrayInputStream bais = new ByteArrayInputStream(icalBaos.toByteArray());
/*     */     try {
/* 415 */       ZCalendar.ZCalendarBuilder.buildMulti(bais, "utf-8");
/*     */     } catch (ServiceException e) {
/* 417 */       sLog.warn("Problem validating ICALENDAR for %s", mimeFile.getPath(), e);
/* 418 */       return false;
/*     */     }
/* 420 */     return true;
/*     */   }
/*     */   
/*     */   private static class TestContentHandler implements ContentHandler
/*     */   {
/*     */     boolean mDebug;
/* 426 */     List<ZCalendar.ZVCalendar> mCals = new ArrayList(1);
/* 427 */     ZCalendar.ZVCalendar mCurCal = null;
/* 428 */     List<ZCalendar.ZComponent> mComponents = new ArrayList();
/* 429 */     ZCalendar.ZProperty mCurProperty = null;
/*     */     private int mNumCals;
/*     */     private boolean mInZCalendar;
/*     */     private int mIndentLevel;
/*     */     
/* 434 */     public TestContentHandler(boolean debug) { this.mDebug = debug; }
/* 435 */     public List<ZCalendar.ZVCalendar> getCals() { return this.mCals; }
/*     */     
/* 437 */     public boolean inZCalendar() { return this.mInZCalendar; }
/* 438 */     public int getNumCals() { return this.mNumCals; }
/*     */     
/*     */     private void printDebug(String format, Object... objects) {
/* 441 */       if (this.mDebug) {
/* 442 */         int indentChars = this.mIndentLevel * 2;
/* 443 */         for (int i = 0; i < indentChars; i++)
/* 444 */           System.out.print(' ');
/* 445 */         System.out.println(String.format(format, objects));
/*     */       }
/*     */     }
/*     */     
/*     */ 
/*     */ 
/*     */     public void startCalendar()
/*     */     {
/* 453 */       printDebug("<calendar>", new Object[0]);
/* 454 */       this.mIndentLevel += 1;
/*     */       
/* 456 */       this.mInZCalendar = true;
/* 457 */       this.mCurCal = new ZCalendar.ZVCalendar();
/* 458 */       this.mCals.add(this.mCurCal);
/*     */     }
/*     */     
/*     */     public void endCalendar()
/*     */     {
/* 463 */       this.mIndentLevel -= 1;
/* 464 */       if (this.mIndentLevel < 0) {
/* 465 */         printDebug("[UNMATCHED endCalendar/endComponent/endProperty]", new Object[0]);
/* 466 */         this.mIndentLevel = 0;
/*     */       }
/* 468 */       printDebug("</calendar>", new Object[0]);
/*     */       
/* 470 */       this.mCurCal = null;
/* 471 */       this.mInZCalendar = false;
/* 472 */       this.mNumCals += 1;
/*     */     }
/*     */     
/*     */ 
/*     */     public void startComponent(String name)
/*     */     {
/* 478 */       printDebug("<component:%s>", new Object[] { name });
/* 479 */       this.mIndentLevel += 1;
/*     */       
/* 481 */       ZCalendar.ZComponent newComponent = new ZCalendar.ZComponent(name);
/* 482 */       if (this.mComponents.size() > 0) {
/* 483 */         ((ZCalendar.ZComponent)this.mComponents.get(this.mComponents.size() - 1)).addComponent(newComponent);
/*     */       } else {
/* 485 */         this.mCurCal.addComponent(newComponent);
/*     */       }
/* 487 */       this.mComponents.add(newComponent);
/*     */     }
/*     */     
/*     */     public void endComponent(String name)
/*     */     {
/* 492 */       this.mIndentLevel -= 1;
/* 493 */       if (this.mIndentLevel < 0) {
/* 494 */         printDebug("[UNMATCHED endCalendar/endComponent/endProperty]", new Object[0]);
/* 495 */         this.mIndentLevel = 0;
/*     */       }
/* 497 */       printDebug("</component:%s>", new Object[] { name });
/*     */       
/* 499 */       this.mComponents.remove(this.mComponents.size() - 1);
/*     */     }
/*     */     
/*     */     public void startProperty(String name)
/*     */     {
/* 504 */       printDebug("<property:%s>", new Object[] { name });
/* 505 */       this.mIndentLevel += 1;
/*     */       
/* 507 */       this.mCurProperty = new ZCalendar.ZProperty(name);
/*     */       
/* 509 */       if (this.mComponents.size() > 0) {
/* 510 */         ((ZCalendar.ZComponent)this.mComponents.get(this.mComponents.size() - 1)).addProperty(this.mCurProperty);
/*     */       } else {
/* 512 */         this.mCurCal.addProperty(this.mCurProperty);
/*     */       }
/*     */     }
/*     */     
/*     */     public void propertyValue(String value)
/*     */       throws ParserException
/*     */     {
/* 519 */       printDebug("<value>%s</value>", new Object[] { value });
/*     */       
/* 521 */       String propName = this.mCurProperty.getName();
/* 522 */       if ((propName.equalsIgnoreCase("CATEGORIES")) || (propName.equalsIgnoreCase("RESOURCES")) || (propName.equalsIgnoreCase("FREEBUSY")))
/*     */       {
/*     */ 
/* 525 */         this.mCurProperty.setValueList(ZCalendar.parseCommaSepText(value));
/*     */       } else {
/* 527 */         this.mCurProperty.setValue(value);
/*     */       }
/*     */     }
/*     */     
/*     */     public void endProperty(String name)
/*     */     {
/* 533 */       this.mIndentLevel -= 1;
/* 534 */       if (this.mIndentLevel < 0) {
/* 535 */         printDebug("[UNMATCHED endCalendar/endComponent/endProperty]", new Object[0]);
/* 536 */         this.mIndentLevel = 0;
/*     */       }
/* 538 */       printDebug("</property:%s>", new Object[] { name });
/*     */       
/* 540 */       this.mCurProperty = null;
/*     */     }
/*     */     
/*     */ 
/*     */     public void parameter(String name, String value)
/*     */     {
/* 546 */       printDebug("<parameter name=\"%s\">%s</parameter>", new Object[] { name, value });
/*     */       
/* 548 */       ZCalendar.ZParameter param = new ZCalendar.ZParameter(name, null);
/* 549 */       param.setValue(value);
/* 550 */       if (this.mCurProperty != null) {
/* 551 */         this.mCurProperty.addParameter(param);
/*     */       } else {
/* 553 */         ZimbraLog.calendar.debug("ERROR: got parameter " + name + "," + value + " outside of Property");
/*     */       }
/*     */     }
/*     */   }
/*     */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/util/tnef/TestMain.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */